#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include <string.h>

int is(const char* arr1, const char* arr2)
{
	while (*arr2)
	{
		if (*arr1 == *arr2)
		{
			return 1;
		}
		arr2++;
	}
	return 0;
}

char* my_strtok(const char* arr1, const char* arr2)
{
	static char* rember = NULL;
	char* qidian = NULL;
	if (arr1 != NULL)
	{
		qidian = (char*)arr1;
	}
	else
	{
		qidian = rember;
	}
	if (*qidian == '\0')
	{
		return NULL;
	}
	char* ret = qidian;
	while (*qidian != '\0')
	{
		if (is(qidian, arr2))
		{
			*qidian = '\0';
			qidian++;
			break;
		}
		qidian++;
	}
	rember = qidian;
	return ret;
}

int main()
{
	char arr[] = "zheng.yuhang@qq.com";
	char bj[] = "@.";
	char cpy_arr[30] = { 0 };
	strcpy(cpy_arr, arr);
	char* p = NULL;
	for (p = my_strtok(cpy_arr, bj); p != NULL; p = my_strtok(NULL, bj))
	{
		printf("%s\n", p);
	}
	return 0;
}